<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	List<TblCheckShift> list = (List<TblCheckShift>)request.getAttribute("list");
	LeaveForm form = (LeaveForm)request.getAttribute("command");
%>
<div class="main">
	<div class="oaTable">
<table class="tableList">
	<thead>
		<tr>
			<td colspan="11" style="width: 100%;">
				<div class="FormTools">
					<div>
						<input type="button" class="searchSubmit" onclick="javascript:XF.Check.shiftListSearch()" value="搜索"/>
					</div>
					<div>所属公司：
						<select id="siteList" class="easyui-combobox" name="siteid" style="width:100px;"></select>
					</div>
				</div>
			</td>
		</tr>
	</thead>

	<tbody>
		<tr id="tableHeader">
			<th style="width: 10%">班次名称</th>
			<th style="width: 5%">所属公司</th>
			<th style="width: 5%">一时段上班时间</th>
			<th style="width: 5%">一时段下班时间</th>
			<th style="width: 5%">二时段上班时间</th>
			<th style="width: 5%">二时段下班时间</th>
			<th style="width: 5%">三时段上班时间</th>
			<th style="width: 5%">三时段下班时间</th>
			<th style="width: 5%">添加人</th>
			<th style="width: 10%">添加时间</th>
			<th style="width: 12%">操作</th>
		</tr>
		<%
			if (list != null && list.size() > 0) {
				for (TblCheckShift shift: list) {
					String id = EncrypTool.encode(shift.getId()+"");
					%>
						<tr>
							<td><%=shift.getShiftName() %></td>
							<td><%=shift.getSiteName() %></td>
							<td><%=StringUtils.isNotBlank(shift.getfCheckintime())?shift.getfCheckintime():""%></td>
							<td><%=StringUtils.isNotBlank(shift.getfCheckouttime())?shift.getfCheckouttime():""%></td>
							<td><%=StringUtils.isNotBlank(shift.getsCheckintime())?shift.getsCheckintime():""%></td>
							<td><%=StringUtils.isNotBlank(shift.getsCheckouttime())?shift.getsCheckouttime():""%></td>
							<td><%=StringUtils.isNotBlank(shift.gettCheckintime())?shift.gettCheckintime():""%></td>
							<td><%=StringUtils.isNotBlank(shift.gettCheckouttime())?shift.gettCheckouttime():""%></td>
							<td><%=shift.getAddUser() %></td>
							<td><%=null!=shift.getAddTime()?DateFormatUtils.format(shift.getAddTime().getTime(), "yyyy-MM-dd HH:mm:ss"):"" %></td>
							<td>
								<div class="innerBtnWrap">
									<a class="a-btn-microsoft btn" href="javascript:XF.Check.editShift('<%=id %>')">修改</a>
									<a class="a-btn-microsoft btn topBtn" href="javascript:XF.Check.deleteShift('<%=id %>')">删除</a>
								</div>
							</td>
						</tr>
					<%
				}
			}
		%>
        <tr id="tableFooter">
			<td colspan="11">
				<div class="pagination">
					<monggoTag:pagination href="shift_search"
						pageSize="<%=form.getPageSize()%>"
						totalRecord="<%=form.getTotalRecord() %>"
						currentPage="<%=form.getPageNum() %>">
					</monggoTag:pagination>
				</div>
			</td>
		</tr>
	</tbody>
</table>
</div>
</div>
<script>
$('#siteList').combobox({
	url:global.contextPath + '/company/siteList',
	valueField:'siteid',
	textField:'sitename',
});
$('#siteList').combobox('setValue', '<%=form.getSiteid() %>');
</script>